from sqlalchemy import Column, Integer, String, Float, Boolean
from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()

class Item(Base):
    __tablename__ = "items"
    id = Column(Integer, primary_key=True, index=True)
    name = Column(String)
    price = Column(Float)
    is_offer = Column(Boolean, default=None)

class MaterialSpecificationsItem(Base):
    __tablename__ = "material_specifications_items"
    item_id = Column(Integer, primary_key=True, index=True)
    name = Column(String)
    spec = Column(String)
    unit = Column(String)
    price_per_unit = Column(Float)

class MaterialItem(Base):
    __tablename__ = "material_items"
    item_id = Column(Integer, primary_key=True, index=True)
    name = Column(String)
    spec = Column(String)
    unit = Column(String)
    price_per_unit = Column(Float)
    count = Column(Integer)
    total_price = Column(Float)
    address = Column(String)
    material_request_id = Column(Integer)

class MaterialCountItem(Base):
    __tablename__ = "material_count_items"
    id = Column(Integer, primary_key=True, index=True)
    address = Column(String)
    total_price = Column(Float)
    material_request_id = Column(Integer)

class AddressItem(Base):
    __tablename__ = "address_items"
    item_id = Column(Integer, primary_key=True, index=True)
    address = Column(String)

class MaterialRequestItem(Base):
    __tablename__ = "material_request_items"
    id = Column(Integer, primary_key=True, index=True)
    request_id = Column(Integer)
    user = Column(String)
    total_price = Column(Float)
    datetime = Column(String)